import assert = require('assert');
import {Meta} from "../expressExt/public/Meta";

class arrClas {

}

class metaClas {

    @Meta.arrayType(arrClas)
    arr = [];
}

describe('meta Test', function () {

    it('setData', function () {
        Meta.setData(arrClas, "ttt", "aaa", 0);
        Meta.setData(arrClas, "ttt", "bbb", 1);
        Meta.setData(arrClas, "cccc", "", 2);

        assert.equal(Meta.getData(arrClas, "ttt", "aaa"), 0);
        assert.equal(Meta.getData(arrClas, "ttt", "bbb"), 1);
        assert.equal(Meta.getData(arrClas, "cccc", ""), 2);

        assert.equal(Meta.getArrayType(metaClas, "arr"), arrClas);
    });
});